package com.zy.cat.entity.game.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.zy.cat.entity.dev.CatDevSignedHistory;
public interface CatDevSignedHistoryRepository extends JpaSpecificationExecutor<CatDevSignedHistory>,  JpaRepository<CatDevSignedHistory, String>{
	public CatDevSignedHistory findByPidAndStime(String pid,String stime);
	
	//查询此微信ID下所有账号总签到次数
	@Query(nativeQuery = true,value = "SELECT COUNT(0) FROM zy_cat_user_signed_history WHERE pid IN (SELECT  pid FROM zy_cat_user WHERE unionid=:unionid)")
	public int countByUnionid(@Param("unionid") String unionid);
}
